//
//  SelectedBtn.m
//  CarTown
//
//  Created by xionghao on 15/8/25.
//  Copyright (c) 2015年 熊浩. All rights reserved.
//

#import "SelectedBtn.h"

@implementation SelectedBtn

-(instancetype)init{
    if (self=[super init]) {
        self.titleLabel.textAlignment=NSTextAlignmentCenter;
    }
    return self;
}

-(instancetype)initWithFrame:(CGRect)frame{
    if (self=[super initWithFrame:frame]) {
        self.titleLabel.textAlignment=NSTextAlignmentCenter;
    }
    return self;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
-(CGRect)imageRectForContentRect:(CGRect)contentRect{
    CGFloat x=contentRect.size.width-12;
    CGFloat y=(contentRect.size.height-12)*0.5;
    CGFloat width=12;
    CGFloat height=12;
    return CGRectMake(x, y, width, height);
}

-(CGRect)titleRectForContentRect:(CGRect)contentRect{
    CGFloat x=32;
    CGFloat y=0;
    CGFloat width=contentRect.size.width-44;
    CGFloat height=contentRect.size.height;
    return CGRectMake(x, y, width, height);
}

@end
